﻿-- Function: GuardarEmpleado(integer, character, character,character, integer,integer,integer,character,character,character, integer)

-- DROP FUNCTION GuardarEmpleado(integer, character, character,character, integer,integer,integer,character,character,character, integer)

CREATE OR REPLACE FUNCTION GuardarEmpleado(integer, character, character,character, character,character)
  RETURNS integer AS
$BODY$

DECLARE
	NumEmpleado		ALIAS FOR $1;
	Contraseña		ALIAS FOR $2;
	Nombre 			ALIAS FOR $3;
	ApellidoP		ALIAS FOR $4;
	ApellidoM		ALIAS FOR $5;
	Permisos		ALIAS FOR $6;
	
BEGIN
	insert into caempleados(numempleado,contraseña,nombre,apellidop,apellidom,permisos) values(NumEmpleado,Contraseña,Nombre,ApellidoP,ApellidoM,Permisos);
	return 1;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
